﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;


namespace Atacadao.Web.Helpers
{
    public static class Html
    {
        public static string FormatarDateTime(this HtmlHelper html, object data)
        {
             if (data == null) { return string.Empty; }
    
            DateTime retorno = (DateTime)data;
            return retorno.ToShortDateString();
        }



        public static string Link(this HtmlHelper html, string texto, string src, IDictionary<string, object> atributos)
        {
            TagBuilder tag = new TagBuilder("a");

            if (atributos != null) { tag.MergeAttributes(atributos); }

            tag.MergeAttribute("src", src);
            tag.SetInnerText(texto);

            return tag.ToString(TagRenderMode.SelfClosing);

        }

    }
}